import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main1(String[] args) {
        int a = 10 ;
        if(a == 10){
            System.out.println("a = 9");
        }
    }

    public static void main2(String[] args) {
        int a = 9 ;
        if(a % 2 == 0) {
            System.out.println("偶数");
        }else {
            System.out.println("奇数");
        }
    }

    public static void main3(String[] args) {
        int a = 1;
        while (a <= 10){
            System.out.print(a+" ");
            a++;
        }
    }

    public static void main4(String[] args) {
        int a = 1;
        int sum = 1;
        while (a <= 5) {
            sum =sum*a++;
        }
        System.out.println(sum);
    }

    public static void main5(String[] args) {
        int i = 1;
        while (i <= 100){
            if (i % 15 !=0) {
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }

    public static void main6(String[] args) {
        int sum = 0;
        for (int k = 1; k <= 5; k++) {
            int ret = 1;
            for (int i = 1; i <= k; i++) {
                ret *= i;
            }
            sum += ret;
        }
        System.out.println(sum);
    }

    public static void main7(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入你的姓名：");
        String name = scan.nextLine();
        System.out.print("请输入你的年龄：");
        int ages = scan.nextInt();
        System.out.print("请输入你的工资：");
        float wages = scan.nextFloat();
        System.out.print("姓名：" + name + " " + "年龄：" + ages + " " + "工资：" + wages);

        scan.close();
    }

    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int randNum = random.nextInt(100);
        System.out.println("请输入你猜的数字：");
        while (true){
            int n = scanner.nextInt();
            if (n > randNum) {
                System.out.println("猜大了！");
            }else if (n == randNum) {
                System.out.println("恭喜你，猜对了！");
                break;
            }else {
                System.out.println("猜小了！");
            }
        }
    }

    public static void main9(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if ((i % 10) == 0 ) {
                count += 1;
            }
            if ((i / 10) == 9) {
                count +=1;
            }
        }
        System.out.println(count);
    }

    public static void main10(String[] args) {
        for (int year = 1000; year <= 2000; year++) {
            if (((year % 4 ==0) && (year % 100 != 0))||(year % 400 == 0)) {
                System.out.print(year+" ");
            }
        }
    }

    public static void main11(String[] args) {
        int i = 0;
        int j = 0;
        for ( i = 1; i <= 100; i++) {
            for ( j = 2; j <= Math.sqrt(i); j++) {
                if (i % j == 0) {
                    break;
                }
            }if (j > Math.sqrt(i)) {
                System.out.print(i+" ");
            }
        }
    }

    public static void main12(String[] args) {
        int i = 0;
        int n = 48;
        for ( i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                break;
            }
        }
        if (i > Math.sqrt(n)) {
            System.out.println(n+"是素数");
        }else {
            System.out.println(n+"不是素数");
        }
    }

    public static void main13(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入你的年龄：");
        int age = scanner.nextInt();
        if (age < 18) {
            System.out.println("少年");
        }else if (age >18 && age <= 28) {
            System.out.println("青年");
        }else if (age >28 && age <=55) {
            System.out.println("中年");
        }else {
            System.out.println("老年");
        }
    }

    public static void main14(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i+ "*" + j + "=" + i*j + " ");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        int a = 24;
        int b = 50;
        int tmp = 0;
        if (a % b == 0) {
            int min = 0;
            if (a >= b) {
                min = b;
            }else {
                min = a;
            }
            System.out.println(min);
        }else {
            while (a % b != 0) {
                tmp = a % b;
                a = b;
                b = tmp;
            }
            System.out.println(tmp);
        }
    }
}
